<%@page import="beans.Student"%>
<%@page import="servlet.StudentListServlet"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>StudentList</title>
</head>
<body>
	<table border="1" id="list">
		
		
	</table>
</body>
<script src="${pageContext.request.contextPath }/lib/jquery/jquery.js"></script>
<script type="text/javascript">
	$.ajax({
		tpye: 'get',
		dataType: 'json',
		url: '${pageContext.request.contextPath }/ServletAPI',
		success: function (res) {
			console.log(res);
			for (var i = 0; i < res.length; i++) {
				$('#list').append(
					'<tr>'+
						'<td>'+ res[i].id +'</td>'+
						'<td>'+ res[i].name +'</td>'+
						'<td>'+ res[i].gender +'</td>'+
					'</tr>'
				)
			}
		}
	})
</script>
</html>